import  {AjaxSend} from  '../../util/util'

const PRODUCT_INDEX = 'Product_Index_List'

const initState = {
    userlist:[]
}

export function Product_Index_Data(state=initState, action){
    switch(action.type){
        case PRODUCT_INDEX:
            return {...state, userlist:action.payload}
        default:
            return state
    }
}

function Product_Index_List(data){
    return { type:PRODUCT_INDEX, payload:data}
}

export function getProduct_Index_List(type){
    const data={
        _cmd: 'product_index2'
    }
    return dispatch=>{
        AjaxSend(data, (da) =>  {
            dispatch(Product_Index_List(da.data))
        }, (errors)  => {
            alert(errors);
        })
    }
}






